Skip to content

fix(output): keep layer commits from landing a focus scroll at once - #973

Open
minhduc17801 wants to merge 1 commit into
noctalia-dev:mainfrom
minhduc17801:fix/layer-commit-keeps-scroll
Open

minhduc17801 wants to merge 1 commit into
noctalia-dev:mainfrom
minhduc17801:fix/layer-commit-keeps-scroll

Conversation

@minhduc17801

@minhduc17801 minhduc17801 commented Dec 2, 2026 •

Copy link
Copy Markdown

Summary

Output::arrangeLayers now re-arranges the active workspace only when the usable area actually changes. Before, every layer commit queued an unanimated arrange. When a layer surface mapped right after a focus change, that arrange overrode the animated one the focus had queued, and the scrolling strip jumped to its target in one frame.

Motivation

With the scrolling layout and fcitx5, moving focus to a window that uses a different input method makes Noctalia show its keyboard-layout OSD within the same frame as the focus change. The strip then skips its scroll animation and lands at once. With that OSD turned off, the scroll animates normally.

Cause: a layer's initial commit calls arrangeLayers directly, and arrangeLayers always called markArrange(false), even for a layer that reserves nothing. markArrange keeps the last mark, so the unanimated mark won over the animated arrange from the focus change. The fix moves that markArrange(false) into the branch that already detects a changed usable area (previously used only for the debug log), and resets the tracked area when the output has no effective size so a re-enabled output arranges again.

Type of Change

  • Bug fix

Testing

  • New check animation/layer_commit_keeps_scroll: a layer surface makes its initial commit right after a focus scroll is requested, and the strip must still be mid-scroll 40 ms in. layer-client gains a commit-on-stdin option that holds the initial commit until a line arrives on stdin. The check runs the output at 10 Hz so the focus request and the commit land in one frame.
    • Without the fix: just check-stress animation/layer_commit_keeps_scroll 32 → 32 failed.
    • With the fix: 32 passed.
  • just test: 169/169 passed.
  • just check (full suite): the same set of checks fails on my machine with and without this change (their clients never map in this environment), so the change adds no new failures.
  • just lint src/output/output.cpp tests/harness/clients/layer_client.cpp: clean.
  • just format-code: no changes.

Manual Coverage

  • Tested in a native Umbriel session
  • Tested with native Wayland applications
  • Tested with the scrolling layout

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • This change fits SCOPE.md, or its scope was agreed in an issue or on Discord first.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format, or this PR has no C++, shader, or Markdown changes.
  • I ran the relevant build, test, lint, or verification commands, or explained why they were not run.
  • I functionally verified compositor behavior where automated checks are insufficient.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I updated docs/ and examples/config.toml, or this PR does not change user-facing configuration or behavior.
  • I used canonical names for config keys, IPC actions, paths, and identifiers.

Additional Notes

Reproduced and measured in my native session (Noctalia shell, fcitx5) on the unfixed build: the strip was already at its target 7 ms after the focus change while the OSD mapped, and the same move without an input-method change animated normally. With this build installed in the same session, focus changes that show the keyboard-layout OSD scroll with their animation.

Output::arrangeLayers marked the active workspace for an unanimated arrange
on every layer commit, even when the usable area was unchanged. A layer that
maps right after a focus change, such as a shell OSD shown when the input
method switches with focus, overrode the animated arrange the focus queued,
so the scrolling strip jumped to its target in one frame.

Re-arrange only when the usable area actually changes.
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The description now contains the required template structure.

@minhduc17801
minhduc17801 marked this pull request as ready for review December 2, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant